package at.fhj.itm11.forum.beans;

import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;

import at.fhj.itm11.forum.service.IconService;
import at.fhj.itm11.forum.service.dtos.IconDTO;

@ManagedBean
@RequestScoped
public class IconBean implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 66251828508026556L;

	@Inject
	@Named("iconServiceImpl")
	private IconService iconService;
	
	private List<IconDTO> icons;
	
	@PostConstruct
	public void init() {
		icons = iconService.retrieveAllIconsOrderedByFileName();
	}

	public List<IconDTO> getIcons() {
		return icons;
	}

	public void setIcons(List<IconDTO> icons) {
		this.icons = icons;
	}

	public IconService getIconService() {
		return iconService;
	}

	public void setIconService(IconService iconService) {
		this.iconService = iconService;
	}
}